export default class ChartBase {
	constructor(){
		this.option={};
	}
	getOption(params={}){
		this.option = {
			title: {
				text: params.title ||'',
				textStyle:{
					fontSize:15,
					color:'#000',
					fontWeight: 'bold'
				}
			},
			tooltip:{trigger: 'axis'},
			color:params.color || ['#1890ff'],
            legend: {
                show:false
            },
			grid:{
				containLabel:true,  //避免轴标签文字溢出现象
				top:50,
				bottom:20,
				left:0,
				right:0
			},
			series: []
		};
		if(params.yAxisLabelFormatter && params.yAxisLabelFormatter=='%'){
			this.option.tooltip.formatter = function(value){
				return value[0].name + '<br/>' + (value[0].value * 100).toFixed(2) + params.yAxisLabelFormatter;
			}
		}
		return this.option;
	}
}